package com.by.service.impl;

import com.by.bean.Full;
import com.by.bean.query.FullQuery;
import com.by.common.core.bean.PageBean;
import com.by.common.core.crud.BaseServiceImpl;
import com.by.mapper.FullMapper;
import com.by.query.FullQuery;
import com.by.service.FullService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 满额活动业务层
 */
@Service
public class FullServiceImpl extends BaseServiceImpl<Full, FullMapper> implements FullService {
    @Autowired
    FullMapper fullMapper;

    @Override
    public PageBean search(FullQuery query) {
        PageHelper.startPage(query.getPage(), query.getPageSize());
        List list=fullMapper.search(query);
        PageInfo info=new PageInfo<>(list);
        return new PageBean(query.getPage(),query.getPageSize(),info.getTotal(),list);
    }
}
